Skip to content

fix(plugin-form): the master-detail dialog Save bar sits at the dialog bottom; section nav follows a scroll inside the click hold - #34848

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-34819-subform-dialog-footer-gap
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-34819-subform-dialog-footer-gap

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs

Fixes #34819

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:带内嵌子表的新建/编辑弹窗,「取消 / 创建」按钮栏改为固定在弹窗底部(不再随滚动区上浮);分组导航在点击后的 800ms 保持期结束时再按滚动位置重算一次高亮。
  • 为什么改:按钮栏原是滚动区里的 sticky 元素,停在滚动区内边距之上,滚到底还会再上移,下方留白;点完分组立刻提交校验失败时,跳回顶部的滚动落在保持期内被忽略,高亮停在原分组。
  • 风险与回滚:只动 plugin-form 三个文件加一个内部 context 文件;抽屉与整页表单仍走原 sticky 路径,结构未变。回滚即 revert 本 PR。
  • 先看:ui/packages/plugin-form/src/MasterDetailForm.tsx(根节点分 frame / flow 两种布局的那段)、ModalForm.tsx(子表分支改用 MasterDetailFrameContext)、FormSectionNav.tsx(保持期结束重算与「到底时保留点击的分组」)。
  • 两分钟验证:showcase 打开任一带内嵌子表对象的「新建」弹窗(如 Invoice),滚到任意位置,按钮栏下沿到弹窗下沿应恒为 25px(24px 内边距 + 1px 边框),与无子表弹窗的页脚一致。
  • 需要你做的:无,席位落地。

What changes

  • Save bar (item 1). ModalForm's master-detail arm no longer wraps MasterDetailForm in an overflow scroller. It hands the form a frame through a new package-internal context, MasterDetailFrameContext (masterDetailFrame.ts, not re-exported from the package index; no prop or schema key added to any exported type). With a frame, MasterDetailForm lays out as a flex column: its body (header form, line items, row editor) scrolls in its own box (md-form-body, the flat arm's body gutters and @container), and the action bar is the shrink-0 row below it, outside the scrolled content, with the flat arm footer's padding. Without a frame (the drawer, the record page) the form renders exactly the old DOM with the sticky bar. The form still owns its Save (ADR-0035 Decision §6); the dialog draws no footer, and the close guard is unchanged.
  • Section navigation (item 2). FormSectionNav measures once more when the 800 ms click hold ends, so a scroll that landed inside the hold is followed. At the very bottom of a short tail, the section the last click picked keeps the highlight while its heading is in view (otherwise the last section, as before); the click preference is dropped as soon as a measure finds the form away from the bottom.
  • Nav counts, the maximize button and the rest of 带内嵌子表的表单弹窗:取消 / 保存不固定在底部,长表单要滚到最下面才看得到 #34599 are untouched.

Why

Measured live (showcase on this branch's base c513d62a, isolated backend plus the Console dev server, Chromium at 1280×900). Showcase has no master-detail object whose create dialog draws two or more sections, so for the reproduction the showcase_invoice header fields were given three field groups in an uncommitted local edit (restored afterwards; not in this diff). That dialog measured 45..855, the same box as the card's.

  • Gap cause. The bar was sticky bottom-0 inside the dialog body scroller (py-4). Sticky stops at the scroller's content edge, so the bar's bottom sat 16 px (the scroller's bottom padding) plus the dialog's own 24 px padding (sm:p-6, which the content's p-0 does not override from sm up) plus 1 px border above the dialog's bottom: 41 px idle; the Create button 53 px (card: about 55). The sticky box also cannot leave its containing block (the form root), so anything in the scroll content past the root lifts it with the scroll: here the bar's own after: strip, 8 px (41 to 49 at the end). The card's 134 px at 条款 was not reproduced on showcase; it is the same mechanism with more content past the form root in that form.
  • Highlight cause. The scroll spy skips every scroll event during the 800 ms hold a click starts, and nothing measured after the hold. Clicking the last entry and submitting at once with the required fields empty: the scroll back ran 13 scroll events on the body scroller, all inside the hold, and ended at scrollTop 0 with the first section marked "· 2" and the highlight still on the last section. Submitting 1200 ms after the click (the hold over) followed correctly, so the defect is the hold window.

Verification

Merged head d603500f44. git merge --no-ff origin/main at 7752cac7 (23 commits behind) merged with no conflicts and no hand resolution; git show --remerge-diff d603500f44 is empty, and the branch delta against origin/main is still exactly the 7 files of this change. On the merged head, after pnpm install --frozen-lockfile and rebuilding the plugin-form^... closure (turbo, 52/52): pnpm --filter @object-ui/plugin-form run type-check exit 0 (0 error TS); vitest run packages/plugin-form/ Test Files 237 passed (237), Tests 2658 passed | 1 skipped (lock VERDICT command-exit 0); overlap-check clean exit 0 against origin/main d947a93cf8 and 0 PR heads. The browser measurements below were taken on 626ff4da2a; origin/main changed no file under ui/packages/plugin-form in the merged range.

Bar bottom to dialog bottom, showcase_invoice create dialog (grouped as above), idle / mid-scroll / end:

viewport theme size before after
1280×900 light normal (45..855) 41 / 41 / 49 25 / 25 / 25
1280×900 dark normal (45..855) 41 / 41 / 49 25 / 25 / 25
1280×900 light maximized (23..878) 41 / 41 / 49 25 / 25 / 25
1280×900 dark maximized (23..878) 41 / 41 / 49 25 / 25 / 25
390×844 light phone sheet (0..844) 16 / 16 / 24 0 / 0 / 0
390×844 dark phone sheet (0..844) 16 / 16 / 24 0 / 0 / 0

Reference: a dialog without a sub-table (showcase_account create) measures footer bottom to dialog bottom 25 px at 1280×900 (24 px padding + 1 px border), so 25 is "the dialog's padding" the card asks for; at phone width the sheet has no padding. The Create button now sits 37 px above the dialog bottom, the same as the flat arm's.

Highlight, same dialog after the fix: click the last entry and submit at once: highlight on the first section (was: the last). Controls: click the second / last entry and wait 1500 ms: the highlight stays on the clicked entry; sampled every 50 ms through a jump from the top to the last entry (30 samples): only the clicked entry was ever highlighted.

Tests

Test and ablation readings (head 626ff4d)
Gates (head 626ff4d)

node scripts/pm/dispatch-gates.mjs --commands derived 38 families from the 7-path change set; all 38 ran locally with exit 0 (each exit captured before any pipe), and --ran reconciled 38 derived, 38 run, 0 not measured, 0 unrun. node scripts/check-new-cross-file-line-citations.mjs: 0 new citations. overlap-check: clean exit 0 against origin/main and 0 PR heads, before each push. The full CI farm is CI's.

Acceptance notes

  • The record dialog's content keeps sm:p-6 from MobileDialogContent because the p-0 the dialog passes does not override a variant class; both arms draw inside that 24 px padding, and the header's own sm:pt-6 adds to it. Left as is: the card's target is the dialog's padding, which is this value.
  • In the master-detail arm the section navigation is the header form's own strip, sticky top-0 inside the body scroller, so content scrolls through the scroller's 16 px top padding above it (visible in the screenshots of both the old and the new layout). Not changed here.
  • The drawer host keeps the sticky bar; it was not measured in this change.
  • The reproduction used a local field-group edit of showcase_invoice; no committed example has a master-detail create dialog with two or more sections.

Generated by Claude Code

…og bottom; section nav re-measures after the click hold

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgwLiKcfujYUug7sPs
…light after the click hold

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgwLiKcfujYUug7sPs
… the section highlight

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzgwLiKcfujYUug7sPs
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB

L1 review · 2026-11-17T14:01Z

L1: ACCEPT
Head-sha: 626ff4d

Read at this exact head: the 7 files (+349/−32), the body, card #34819, claim 6948244346, amendment 6949796831 and os-dev-report 6949743942. check-governed-merges: not governed, 381 lines. Check-runs on this sha: 53 total, 40 success, 13 skipped, 0 failed or pending.

Must-fix

None.

Should-fix

None.

Checklist

  • Shape: draft, Fixes #34819. Both declaration lines (Clause-②: no, Metadata-protocol: none) match the claim. MasterDetailFrameContext and MasterDetailFrame live in a new module that the package index does not re-export, so no exported prop, type or schema key changes. no holds.
  • Surface: ModalForm.tsx, MasterDetailForm.tsx, FormSectionNav.tsx and the changeset are inside the claim. masterDetailFrame.ts and the pins in the shared harness files subformHosts.test.tsx and FormSectionNav.test.tsx are covered by amendment 6949796831 (AGENTS.md ruling 6583487846). No unrelated files.
  • Changeset: one @object-ui/plugin-form patch, the only package whose src moved.
  • Change, read through:
    • Save bar.
      • With a frame, the form root becomes flex min-h-0 flex-1 flex-col. The body scrolls in its own md-form-body box, and the bar is a shrink-0 row outside that box. It is no longer sticky, so content past the form root cannot lift it.
      • Without a provider (drawer, record page), the original markup and the sticky classes are unchanged byte for byte.
      • Only the dialog's master-detail arm provides the frame. The gutters it hands over (@container px-4 sm:px-6 py-4 for the body, px-4 sm:px-6 py-3 for the bar) are the flat arm's.
      • Save stays inside the form (ADR-0035 §6). FormDirtyReportContext still wraps the form, so the close guard is unchanged.
    • Section nav.
      • measure still returns early while holding is set. The hold's timeout now clears holding and calls the bound onScroll, so a scroll that landed inside the hold is measured once after it.
      • At the bottom, the clicked anchor wins only while its heading is inside the scroller's view. NaN from a missing element falls back to the last section. Any measure away from the bottom clears jumpedTo.
      • The scroll parent is still resolved from the first heading (scrollParentOf), and in the dialog that is now md-form-body.
  • Tests:
    • The commands are real. The whole plugin-form package passes: 237 files, 2658 tests.
    • FormSectionNav has 4 new tests: the hold-end follow, the after-hold follow, and two controls (no passing highlight during the jump, and the clicked section keeps the highlight on a short tail).
    • subformHosts has 2 bar-frame pins, normal and maximized. The drawer and page sticky cases are kept.
    • Four ablations (A–D) each turn their target red, and the restores are blob-verified.
  • Acceptance:
    • Measured live before and after at 1280×900, light and dark, normal and maximized: bar bottom to dialog bottom goes from 41/41/49 to 25/25/25, equal to the flat dialog's footer. On the 390×844 sheet it goes from 16/16/24 to 0/0/0.
    • The highlight follows a refused submit right after a jump.
    • The card's 134 px did not reproduce on showcase (49 px at most). The amendment records that the mechanism is the same and that the filer re-checks it on hotcrm.
  • Docs made false: none. content/docs and docs/adr say nothing about a sticky Save bar in the dialog. The in-code comments in ModalForm.tsx and MasterDetailForm.tsx were updated with the change.
  • UI strings: none.

Notes

  • N1: The report's class-a out-of-scope finding gives dedupe words but no carrier. In the master-detail dialog, content shows through the body scroller's 16 px top padding above the sticky-top FormSectionNav. It needs a filed card before the area closes out.
  • N2: MobileDialogContent keeps sm:p-6 because p-0 does not override the variant class. Both arms draw inside it, and the 25 px target includes it. This is declared and has no carrier.
  • N3: The live repro used an uncommitted field-group edit of the showcase invoice object, which was restored. No committed example exercises a master-detail create dialog with 2+ sections, so only the unit pins guard this path in CI.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs

Landing · area o3-B · 2026-11-17T14:41Z

Probe Reading
L1 ACCEPT 6950249233 at 626ff4da2a; no must-fix, no should-fix; N1–N3 are nits and stay open under the nit-only landing standard (seat 14:05Z: a card per nit is not required)
Head move since L1 d603500f448a8feef7ac75aef1f7ffa135ee179a = clean git merge --no-ff origin/main (7752cac, 23 commits, K was 23); git show --remerge-diff d603500f44 empty; PR delta still the same 7 files; origin/main touched no ui/packages/plugin-form file in the merged range — the ACCEPT carries over
L2 (Clause-②: no) not owed (no export of @object-ui/plugin-form grows; seat amendment 6949796831)
Checks on head 40 success, 13 skipped, 0 failure / pending; mergeable_state: clean
check-governed-merges.mjs --pr 34848 NOT governed; 381 changed lines ≤ 3000
K (first-parent, merge-base..origin/main d947a93) 1 < 15; no merge=os-regen path in the diff

State change: ready for review + auto-merge (merge queue). Card #34819 closes on merge via Fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

带内嵌子表的表单弹窗:取消 / 创建下方留出一段空白;分组导航在校验跳回顶部后高亮不跟着变

2 participants